using System;
using System.Globalization;
using System.Reflection.Emit;

namespace RaisingStudio.SmallBasicCompiler.Statements
{
	public class SubroutineCallStatement : Statement
	{
		public TokenInfo SubroutineName;
		public override void EmitIL(CodeGenScope scope)
		{
			MethodBuilder methodInfo = scope.MethodBuilders[this.SubroutineName.NormalizedText];
			scope.ILGenerator.EmitCall(OpCodes.Call, methodInfo, null);
		}
		public override string ToString()
		{
			return string.Format(CultureInfo.CurrentUICulture, "{0}()", new object[]
			{
				this.SubroutineName.Text
			});
		}
	}
}
